package com.nopay.cdxphone.ui.adapter;

import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.List;

/**
 * @ProjectName: guizhou_assets
 * @Package: dhc.guizhou.assets.view.adapter
 * @ClassName: MyFragmentAdapter
 * @Description: java类作用描述
 * @Author: Kawaii's cat
 * @CreateDate: 2020-5-18 14:34
 * @UpdateUser: 更新者：
 * @UpdateDate: 2020-5-18 14:34
 * @UpdateRemark: 更新说明：
 * @Version: 1.0
 */
public class MyFragmentAdapter extends FragmentPagerAdapter {
    private List<Fragment> fgList;
    private List<String> list;

    public MyFragmentAdapter(List<Fragment> fgList, List<String> list, FragmentManager fm) {
        super(fm);
        this.fgList = fgList;
        this.list = list;
    }

    @Override
    public Fragment getItem(int position) {
        return fgList.get(position);
    }

    @Override
    public int getCount() {
        return fgList.size();
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return list.get(position);
    }
}
